import Manager from './Manager';
import { EventEmitter } from 'events'
export default class Sizes extends EventEmitter {
    static RESIZE_EVENT = 'resize';
    constructor() {
        super();
        this.manager = new Manager()
        
        this.width = window.innerWidth;
        console.log(this.width);
        
        this.height = window.innerHeight;
        

        this.aspect = this.width / this.height;
        this.pixelRatio = Math.min(window.devicePixelRatio, 2);

        window.addEventListener('resize', () => {
            this.width = window.innerWidth;
            this.height = window.innerHeight;
            this.aspect = this.width / this.height;
            this.pixelRatio = Math.min(window.devicePixelRatio, 2);
            this.emit(Sizes.RESIZE_EVENT);
        })
    }
}